/**
 * 
 */
package sv.gob.mh.dgii.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @author melvin.henriquez
 * 
 */
@Entity
@Table(name = "DV_DEVOLUC_RTA_DET", schema = "DEVOLUCIONES")
public class DvDevolucRtaDet implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7190856801386224931L;
	private DvDevolucRtaDetId id;
	private String nfolio;
	private String cmodelo;
	private Date fpobligacion;
	private Date fpresentacion;
	private Double vmontoDevol;
	private Double vmontoSolicitado;
	private DvDevolucRta dvDevolucRta;

	public DvDevolucRtaDet() {
		// TODO Auto-generated constructor stub
	}

	public DvDevolucRtaDet(DvDevolucRtaDetId id, String cmodelo,
			Date fpobligacion, Double vmontoDevol) {
		this.id = id;
		this.cmodelo = cmodelo;
		this.fpobligacion = fpobligacion;
		this.vmontoDevol = vmontoDevol;
	}

	/**
	 * @return the id
	 */
	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "iindice", column = @Column(name = "I_INDICE", nullable = false, precision = 18, scale = 0)),
			@AttributeOverride(name = "ncorrelativo", column = @Column(name = "N_CORRELATIVO", nullable = false, precision = 18, scale = 0)) })
	public DvDevolucRtaDetId getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(DvDevolucRtaDetId id) {
		this.id = id;
	}

	/**
	 * @return the nfolio
	 */
	@Column(name = "N_FOLIO", nullable = false, length = 12)
	public String getNfolio() {
		return nfolio;
	}

	/**
	 * @param nfolio
	 *            the nfolio to set
	 */
	public void setNfolio(String nfolio) {
		this.nfolio = nfolio;
	}

	/**
	 * @return the cmodelo
	 */
	@Column(name = "C_MODELO", nullable = false, length = 3)
	public String getCmodelo() {
		return cmodelo;
	}

	/**
	 * @param cmodelo
	 *            the cmodelo to set
	 */
	public void setCmodelo(String cmodelo) {
		this.cmodelo = cmodelo;
	}

	/**
	 * @return the fpobligacion
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(insertable = true, name = "FP_OBLIGACION", length = 7, nullable = false, updatable = true)
	public Date getFpobligacion() {
		return fpobligacion;
	}

	/**
	 * @param fpobligacion
	 *            the fpobligacion to set
	 */
	public void setFpobligacion(Date fpobligacion) {
		this.fpobligacion = fpobligacion;
	}

	/**
	 * @return the fpresentacion
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(insertable = true, name = "F_PRESENTACION", length = 7, nullable = false, updatable = true)
	public Date getFpresentacion() {
		return fpresentacion;
	}

	/**
	 * @param fpresentacion
	 *            the fpresentacion to set
	 */
	public void setFpresentacion(Date fpresentacion) {
		this.fpresentacion = fpresentacion;
	}

	/**
	 * @return the vmontoDevol
	 */
	@Column(name = "V_MONTO_DEVOL", nullable = true, precision = 12, scale = 2)
	public Double getVmontoDevol() {
		return vmontoDevol;
	}

	/**
	 * @param vmontoDevol
	 *            the vmontoDevol to set
	 */
	public void setVmontoDevol(Double vmontoDevol) {
		this.vmontoDevol = vmontoDevol;
	}

	/**
	 * @return the vmontoSolicitado
	 */
	@Column(name = "V_MONTO_SOLICITADO", nullable = true, precision = 12, scale = 2)
	public Double getVmontoSolicitado() {
		return vmontoSolicitado;
	}

	/**
	 * @param vmontoSolicitado
	 *            the vmontoSolicitado to set
	 */
	public void setVmontoSolicitado(Double vmontoSolicitado) {
		this.vmontoSolicitado = vmontoSolicitado;
	}

	/**
	 * @return the dvDevolucRta
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "I_INDICE", nullable = false, insertable = false, updatable = false)
	public DvDevolucRta getDvDevolucRta() {
		return dvDevolucRta;
	}

	/**
	 * @param dvDevolucRta
	 *            the dvDevolucRta to set
	 */
	public void setDvDevolucRta(DvDevolucRta dvDevolucRta) {
		this.dvDevolucRta = dvDevolucRta;
	}

}
